#include<iostream>
#include<list>
#include <algorithm>
using namespace std;

int main()
{
   std::list<int> mylist1, mylist2;
   std::list<int>::iterator it;

   // set some initial values:
   for (int i = 1; i <= 4; ++i)
       mylist1.push_back(i);      // mylist1: 1 2 3 4

   for (int i = 1; i <= 3; ++i)
       mylist2.push_back(i * 10);   // mylist2: 10 20 30

   it = mylist1.begin();
   ++it;                         // points to 2

   mylist1.splice(it, mylist2); // mylist1: 1 10 20 30 2 3 4
                                 // mylist2 (empty)
                                 // "it" still points to 2 (the 5th element

	return 0;
}
// 

// int main()
// {
//    std::list<int> mylist1;
  
//    for (int i = 1; i <= 4; ++i)
//        mylist1.push_back(i);      // mylist1: 1 2 3 4

//    auto it = find(mylist1.begin(), mylist1.end(), 3);

//    mylist1.splice(mylist1.begin(), mylist1, it);

//    return 0;
// }

#include"List.h"

int main()
{
	ltw::test_list4();

	//std::list<int> mylist1 = { 1,2,3 };
	//auto it = mylist1.begin()+1;
	//it + 10;

	return 0;
}